﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class Student
{
    public Student(string firstName, string middleName, string lastName, string ssn, string address, string mobilePhone, string email, int course, string specialty, string university, string faculty)
    {
        this.name = new FullName(firstName, middleName, lastName);
        this.ssn = ssn;
        this.address = address;
        this.mobilePhone = mobilePhone;
        this.email = email;
        this.course = course;
        this.specialty = specialty;
        this.university = university;
        this.faculty = faculty;
    }
    
    public struct FullName
    {
        string firstName;
        string middleName;
        string lastName;

        public FullName(string firstName, string middleName, string lastName)
        {
            this.firstName = firstName;
            this.middleName = middleName;
            this.lastName = lastName;
        }

        public override string ToString()
        {
            return String.Format("{0} {1} {2}", firstName, middleName, lastName);
        }
    }

    FullName name;
    string ssn;
    string address;
    string mobilePhone;
    string email;
    int course;
    string specialty;
    string university;
    string faculty;

    public FullName Name
    {
        get
        {
            return name;
        }
    }

    public string Ssn
    {
        get
        {
            return ssn;
        }
    }

    public string Address
    {
        get
        {
            return address;
        }
    }

    public string MobilePhone
    {
        get
        {
            return mobilePhone;
        }
    }

    public string Email
    {
        get
        {
            return email;
        }
    }

    public int Course
    {
        get
        {
            return course;
        }
    }

    public string Specialty
    {
        get
        {
            return specialty;
        }
    }

    public string University
    {
        get
        {
            return university;
        }
    }

    public string Faculty
    {
        get
        {
            return faculty;
        }
    }

    public override bool Equals(object obj)
    {
        Student st = obj as Student;
        
        if (st == null)
        {
            return false;
        }

        return this.ToString().Equals(st.ToString());
    }

    public override int GetHashCode()
    {
        var data = new {d1 = ssn,d2 = name.ToString(),d3 = university};
        return data.GetHashCode();
    }

    public override string ToString()
    {
        return String.Format("{0} {1} {2} {3} {4} {5} {6} {7} {8} ", name, ssn, address, mobilePhone, email, course, specialty, university, faculty);
    }
}
